package cn.iocoder.yudao.module.crossborder.platform.controller.admin.platformsynctask.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;

@Schema(description = "管理后台 - 跨境电商数据同步任务新增/修改 Request VO")
@Data
public class PlatformSyncTaskSaveReqVO {

    @Schema(description = "任务编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15143")
    private Long id;

    @Schema(description = "平台编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "484")
    @NotNull(message = "平台编号不能为空")
    private Long platformId;

    @Schema(description = "店铺编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "22521")
    @NotNull(message = "店铺编号不能为空")
    private Long storeId;

    @Schema(description = "同步类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotEmpty(message = "同步类型不能为空")
    private String syncType;

    @Schema(description = "同步方向（1上传到平台 2从平台下载 3双向同步）", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "同步方向（1上传到平台 2从平台下载 3双向同步）不能为空")
    private Integer syncDirection;

    @Schema(description = "业务类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    @NotEmpty(message = "业务类型不能为空")
    private String businessType;

    @Schema(description = "业务数据ID", example = "6104")
    private Long businessId;

    @Schema(description = "批次号")
    private String batchNo;

    @Schema(description = "优先级（1-10，数字越小优先级越高）", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "优先级（1-10，数字越小优先级越高）不能为空")
    private Integer priority;

    @Schema(description = "计划执行时间")
    private LocalDateTime scheduledTime;

    @Schema(description = "开始执行时间")
    private LocalDateTime startTime;

    @Schema(description = "结束执行时间")
    private LocalDateTime endTime;

    @Schema(description = "任务状态（0待执行 1执行中 2执行成功 3执行失败 4已取消）", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    @NotNull(message = "任务状态（0待执行 1执行中 2执行成功 3执行失败 4已取消）不能为空")
    private Integer status;

    @Schema(description = "执行进度（0-100）", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "执行进度（0-100）不能为空")
    private Integer progress;

    @Schema(description = "总数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "18091")
    @NotNull(message = "总数量不能为空")
    private Integer totalCount;

    @Schema(description = "成功数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "789")
    @NotNull(message = "成功数量不能为空")
    private Integer successCount;

    @Schema(description = "失败数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "19338")
    @NotNull(message = "失败数量不能为空")
    private Integer failedCount;

    @Schema(description = "错误信息")
    private String errorMsg;

    @Schema(description = "请求数据JSON")
    private String requestData;

    @Schema(description = "响应数据JSON")
    private String responseData;

    @Schema(description = "重试次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "27686")
    @NotNull(message = "重试次数不能为空")
    private Integer retryCount;

    @Schema(description = "最大重试次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "17343")
    @NotNull(message = "最大重试次数不能为空")
    private Integer maxRetryCount;

    @Schema(description = "下次重试时间")
    private LocalDateTime nextRetryTime;

}